//
//  JiFenDetailBottomV.m
//  JiuJiuShangCheng
//
//  Created by jiujiukeji on 2018/7/19.
//  Copyright © 2018年 jiujiukeji. All rights reserved.
//

#import "JiFenDetailBottomV.h"

@implementation JiFenDetailBottomV

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUpUI];
    }
    return self;
}
- (void)setUpUI
{
    WeakSelf
    self.buyBtn = [UIButton buttonWithTitle:@"立即兑换" fontSize:15 titleColor:UIColorWhite background:navBarColor cornerRadius:0];
    [self addSubview:_buyBtn];
    [_buyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.bottom.top.equalTo(self);
        make.width.equalTo(@(rateWidth(500)));
    }];
    
    self.collectBtn = [UIButton buttonWithTitle:@"收藏" fontSize:11 titleColor:UIColorFromRGB(0x909090) background:UIColorWhite cornerRadius:0];
    [_collectBtn setImage:UIImageNamed(@"detailshoucang") forState:(UIControlStateNormal)];
    [self.collectBtn setImageEdgeInsets:UIEdgeInsetsMake(-self.collectBtn.titleLabel.intrinsicContentSize.height-10, 0, 0, -self.collectBtn.titleLabel.intrinsicContentSize.width)];
    [self.collectBtn setTitleEdgeInsets:UIEdgeInsetsMake(self.collectBtn.currentImage.size.height+5, -self.collectBtn.currentImage.size.width, 0, 0)];
    [self addSubview:_collectBtn];
    [_collectBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.equalTo(self);
        make.right.equalTo(weakSelf.buyBtn.mas_left);
        make.width.equalTo(@((kScreenWidth-rateWidth(500))/2));
    }];
    
    self.serviceBtn = [UIButton buttonWithTitle:@"客服" fontSize:11 titleColor:UIColorFromRGB(0x909090) background:UIColorWhite cornerRadius:0];
    [_serviceBtn setImage:UIImageNamed(@"detailkefu") forState:(UIControlStateNormal)];
    [self.serviceBtn setImageEdgeInsets:UIEdgeInsetsMake(-self.serviceBtn.titleLabel.intrinsicContentSize.height-10, 0, 0, -self.serviceBtn.titleLabel.intrinsicContentSize.width)];
    [self.serviceBtn setTitleEdgeInsets:UIEdgeInsetsMake(self.serviceBtn.currentImage.size.height+5, -self.serviceBtn.currentImage.size.width, 0, 0)];
    [self addSubview:_serviceBtn];
    [_serviceBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.equalTo(self);
        make.left.equalTo(self);
        make.width.equalTo(@((kScreenWidth-rateWidth(500))/2));
    }];
    
}

@end
